from PyQt4 import QtGui
from pyastm.appcontext import ApplicationContext
from pyastm.dao import DaoSpecies, DaoTemplate
from pyastm.gui.pyqt4.widgets import MySpeciesWindow
import logging
import logging.config
import sys



if __name__ == "__main__":
    # logging
    logging.config.fileConfig('./config/logging.conf')
    
    app = QtGui.QApplication(sys.argv)
    applicationContext = ApplicationContext('./config/config.ini')
    window = MySpeciesWindow(applicationContext)
    window.show()
    app.exec_()
    
    # disconnect from the database
    applicationContext.db_disconnect()